<template>
  <div class="not-found">
    <h1 class="title">404</h1>
    <h3>{{ s }}s</h3>
    <a href="/">回到首页</a>
  </div>
</template>

<script>
export default {
  name: "NotFoundComponent",
  data() {
    return {
      s: 5,
    }
  },
  mounted() {
    const self = this
    let timer = setInterval(() => {
      self.s -= 1
      if (self.s <= 0) {
        clearInterval(timer)
        // location.href = '/'
        this.$router.push('/')
      }
    }, 1000)
  },
}
</script>

<style scoped>
.not-found {
  text-align: center;
}
</style>
